import 'package:backend.core/core/domain/entities/api/web/api_web_payment_method_failure.dart';
import 'package:backend.core/core/domain/entities/web/web_payment_method_failure.dart';

abstract class CreateApiWebPaymentMethodFailureFromInternalOne {
  ApiWebPaymentMethodFailure call({
    required WebPaymentMethodFailure failure,
  });
}

class CreateApiWebPaymentMethodFailureFromInternalOneImpl
    implements CreateApiWebPaymentMethodFailureFromInternalOne {
  const CreateApiWebPaymentMethodFailureFromInternalOneImpl();

  @override
  ApiWebPaymentMethodFailure call({
    required WebPaymentMethodFailure failure,
  }) {
    switch (failure) {
      case WebPaymentMethodFailure.cardExpired:
        return ApiWebPaymentMethodFailure.cardExpired;
      case WebPaymentMethodFailure.cardUnavailable:
        return ApiWebPaymentMethodFailure.cardUnavailable;
    }
  }
}
